﻿<!--
    Layout is used to specify which *.cshtml file is used for the layout of the page.
    The content of this page will be inserted into 'RenderBody()' in '_Layout.cshtml'

    Page.Title is the title from the page which will be inserted into 'Page.Title' in
    the '_Layout.cshtml' file.
-->

@{
    Layout = "~/_Layout.cshtml";
    Page.Title = "Razor Code Examples";
}

<!--
    Here are some Code Examples for ASP.NET Webpages with the Razor Syntax
    This collection is by far from being complete, it's just to get some ideas.
-->
<h2>Razor Code Examples</h2>

<h2>Complete Reference</h2>
<p>For complete reference, click: <a href="http://msdn.microsoft.com/en-US/library/gg549171(v=vs.99).aspx">here</a></p>

<!--
    Here are some examples to get DateTime information with ASP.NET
-->
<h3>Simple Date&Time Examples</h3>
    <p>
        DateTime.Now            =>              <b>@DateTime.Now</b>   <br>
        DateTime.Now.DayOfWeek  =>              <b>@DateTime.Now.DayOfWeek</b> <br>
        DateTime.Now.Kind       =>              <b>@DateTime.Now.Kind</b> <br>
    </p>

<!--
    Here are some examples from the 'System.Web' Namespace: The Request Object
-->
<h3>Requests</h3>
    <p>
        Request.Url                         => <b>@Request.Url</b> <br>
        Request.FilePath                    => <b>@Request.FilePath</b> <br>
        Request.MapPath(Request.Filepath)   => <b>@Request.MapPath(Request.FilePath)</b> <br>
        Request.RequestType                 => <b>@Request.RequestType</b> <br>
    </p>

<!--
    This is a small example of how charts are created and used
-->
<h3>Charts</h3>
@{ 
    var basicChart = new Chart(width: 600, height: 400)     // A new chart instance gets created 
        .AddTitle("Chart Title")                            // This is the title of the chart diagramm
        .AddSeries( 
            name: "Employee", 
            xValue: new[] {  "Peter", "Andrew", "Julie", "Mary", "Dave" }, 
            yValues: new[] { "2", "6", "4", "5", "3" });
    // Now we check if a submit button of a form was pressed
    // 'IsPost' is a ready to use Property of ASP.NET
    // further reading: http://msdn.microsoft.com/en-us/library/system.web.webpages.webpagerenderingbase.ispost(v=vs.99).aspx
    if(IsPost)
    {
        basicChart.Write();
    }
}
<form method="post" action="">
    <input type="submit" name="ChartSub" value="Submit">
</form>

<!-- 
    With this, you get your Server Information.
    This is comparable with for example: 'phpinfo()'
-->
@ServerInfo.GetHtml()